// Package calculate_byte_count.
// creator 2022-02-26 21:44:51
// Author  zhenxinma.
package calculate_byte_count

import "fmt"

// CalculateByteCount 计算字节位数用6位数字表示.
// 默认是6位.
func CalculateByteCount(length int) int {

	if length <= 0 {
		return 0
	}

	if length >= 100000 && length <= 999999 {
		fmt.Println(length)
		return length
	} else if length >= 10000 && length <= 99999 {
		fmt.Printf("%s%d", "0", length)
	} else if length >= 1000 && length <= 9999 {
		fmt.Printf("%s%d", "00", length)
	} else if length >= 100 && length <= 999 {
		fmt.Printf("%s%d", "000", length)
	} else if length >= 10 && length <= 99 {
		fmt.Printf("%s%d", "0000", length)
	} else {
		fmt.Printf("%s%d", "00000", length)
	}

	return 0
}
